﻿namespace HPSocketLibrary.Devices
{
    public class MtIntfaceMsgFormat_Body_ReportDeviceSTATUS
    {
        //public string type { get; set; }
        public string device_id { get; set; }
        public string status { get; set; }
        public string time { get; set; }

        public static MtIntfaceMsgFormat_Body_ReportDeviceSTATUS GetDefault(bool isOnline)
        {
            MtIntfaceMsgFormat_Body_ReportDeviceSTATUS msg = new MtIntfaceMsgFormat_Body_ReportDeviceSTATUS()
            {
                //type = "rack",
                status = isOnline ? "2" : "6",
                device_id = MtIntfaceMsgFormat_Head._deviceID,
                time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
            };
            return msg;
        }

        public static MtIntfaceMsgFormat_Body_ReportDeviceSTATUS CreateByCode(string code)
        {
            MtIntfaceMsgFormat_Body_ReportDeviceSTATUS msg = new MtIntfaceMsgFormat_Body_ReportDeviceSTATUS()
            {
                //type = "rack",
                status = code,
                device_id = MtIntfaceMsgFormat_Head._deviceID,
                time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
            };
            return msg;
        }
    }
}